<template>
  <ComForm ref="formRef" :format="format"> </ComForm>
  <ComTable ref="tableRef" :column="column"></ComTable>
  <el-button style="position: fixed; right: 150px; top: 100px" type="info" @click="exportTable"
    >导出</el-button
  >
</template>

<script setup>
import {exportXlsx} from '@/utils/common'


let formRef = ref();
let tableRef = ref();

let column = ref([
  { label: "编号", prop: "postId" },
  { label: "任务名称", prop: "postCode" },
  { label: "项目区域", prop: "postSort" },
  { label: "工作项目", prop: "postSort" },
  { label: "单位", prop: "postSort" },
  { label: "数量", prop: "postSort" },
  { label: "工作方式", prop: "postSort" },
  { label: "附件", prop: "postSort" },
  { label: "备注", prop: "postSort" },
]);

const format = ref([
  {
    label: "时间",
    prop: "postCode",
    type: "date",
    defaultValue: "",
    span: 5,
  },
  {
    label: "类型",
    prop: "type",
    type: "select",
    option: [
      { label: "日常维护", value: 0 },
      { label: "管网修复", value: 1 },
    ],
    span: 5,
  },
  {
    label: "",
    prop: "",
    type: "button",
    btns: [{ label: "查询", event: "submit", type: "success" }],
    span: 5,
  },
]);


function exportTable(){
  exportXlsx("myTable")
}
</script>
<style scoped>
.form {
  padding: 20px 20px;
}
</style>
